package com.cs.study.homework._0217;

import com.cs.study.homework._0205.Print;

public class Demo {
    public static void main(String[] args) {
        Staff staff1 = new Staff("张三","男",6000);
        Staff staff2 = new Staff("李四","男",7000);
        Staff staff3 = new Staff("王五","男",8000);

        staff1.print();
        staff2.print();
        staff3.print();
    }
}

class Staff {
    String name;
    String gender;
    int id;
    double salary;
    static int initid = 10001;

    double accumulationFund = 2000;


    {
        id = initid;
        initid++;
    }



    public Staff(String name) {
        this.name = name;
    }

    public Staff(String name, String gender) {
        this.name = name;
        this.gender = gender;
    }

    public Staff(String name, String gender, double salary) {
        this.name = name;
        this.gender = gender;
        this.salary = salary;
    }

    public void print(){
        System.out.println("姓名：" + name + " 工号：" + id + " 性别：" + gender + " 工资：" + (salary - accumulationFund));
    }
}
